<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>oauth2client.keyring_storage.Storage</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="oauth2client-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="oauth2client-module.html">Package&nbsp;oauth2client</a> ::
        <a href="oauth2client.keyring_storage-module.html">Module&nbsp;keyring_storage</a> ::
        Class&nbsp;Storage
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="oauth2client.keyring_storage.Storage-class.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class Storage</h1><p class="nomargin-top"><span class="codelink"><a href="oauth2client.keyring_storage-pysrc.html#Storage">source&nbsp;code</a></span></p>
<center>
<center>  <map id="uml_class_diagram_for_oauth2cl_45" name="uml_class_diagram_for_oauth2cl_45">
<area shape="rect" id="node1_9" href="oauth2client.keyring_storage.Storage-class.html#__init__" title="Constructor." alt="" coords="17,148,263,167"/>
<area shape="rect" id="node1_10" href="oauth2client.keyring_storage.Storage-class.html#acquire_lock" title="Acquires any lock necessary to access this Storage." alt="" coords="17,167,263,185"/>
<area shape="rect" id="node1_11" href="oauth2client.keyring_storage.Storage-class.html#release_lock" title="Release the Storage lock." alt="" coords="17,185,263,204"/>
<area shape="rect" id="node1_12" href="oauth2client.keyring_storage.Storage-class.html#locked_get" title="Retrieve Credential from file." alt="" coords="17,204,263,223"/>
<area shape="rect" id="node1_13" href="oauth2client.keyring_storage.Storage-class.html#locked_put" title="Write Credentials to file." alt="" coords="17,223,263,241"/>
<area shape="rect" id="node1_14" href="oauth2client.keyring_storage.Storage-class.html#locked_delete" title="Delete Credentials file." alt="" coords="17,241,263,260"/>
<area shape="rect" id="node1" href="oauth2client.keyring_storage.Storage-class.html" title="Store and retrieve a single credential to and from the keyring." alt="" coords="5,117,275,267"/>
<area shape="rect" id="node2_15" href="oauth2client.client.Storage-class.html#get" title="Retrieve credential." alt="" coords="77,36,203,55"/>
<area shape="rect" id="node2_16" href="oauth2client.client.Storage-class.html#put" title="Write a credential." alt="" coords="77,55,203,73"/>
<area shape="rect" id="node2_17" href="oauth2client.client.Storage-class.html#delete" title="Delete credential." alt="" coords="77,73,203,92"/>
<area shape="rect" id="node2" href="oauth2client.client.Storage-class.html" title="Base class for all Storage objects." alt="" coords="65,5,215,99"/>
</map>
  <img src="uml_class_diagram_for_oauth2cl_45.gif" alt='' usemap="#uml_class_diagram_for_oauth2cl_45" ismap="ismap" class="graph-without-title" />
</center>
</center>
<hr />
<pre class="literalblock">
Store and retrieve a single credential to and from the keyring.

To use this module you must have the keyring module installed. See
&lt;http://pypi.python.org/pypi/keyring/&gt;. This is an optional module and is not
installed with oauth2client by default because it does not work on all the
platforms that oauth2client supports, such as Google App Engine.

The keyring module &lt;http://pypi.python.org/pypi/keyring/&gt; is a cross-platform
library for access the keyring capabilities of the local system. The user will
be prompted for their keyring password when this module is used, and the
manner in which the user is prompted will vary per platform.

Usage:
  from oauth2client.keyring_storage import Storage

  s = Storage('name_of_application', 'user1')
  credentials = s.get()

</pre>

<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Instance Methods</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-InstanceMethods"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="oauth2client.keyring_storage.Storage-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">service_name</span>,
        <span class="summary-sig-arg">user_name</span>)</span><br />
      Constructor.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="oauth2client.keyring_storage-pysrc.html#Storage.__init__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="oauth2client.keyring_storage.Storage-class.html#acquire_lock" class="summary-sig-name">acquire_lock</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Acquires any lock necessary to access this Storage.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="oauth2client.keyring_storage-pysrc.html#Storage.acquire_lock">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="oauth2client.keyring_storage.Storage-class.html#release_lock" class="summary-sig-name">release_lock</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Release the Storage lock.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="oauth2client.keyring_storage-pysrc.html#Storage.release_lock">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="oauth2client.keyring_storage.Storage-class.html#locked_get" class="summary-sig-name">locked_get</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Retrieve Credential from file.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="oauth2client.keyring_storage-pysrc.html#Storage.locked_get">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="oauth2client.keyring_storage.Storage-class.html#locked_put" class="summary-sig-name">locked_put</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">credentials</span>)</span><br />
      Write Credentials to file.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="oauth2client.keyring_storage-pysrc.html#Storage.locked_put">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="oauth2client.keyring_storage.Storage-class.html#locked_delete" class="summary-sig-name">locked_delete</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Delete Credentials file.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="oauth2client.keyring_storage-pysrc.html#Storage.locked_delete">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="oauth2client.client.Storage-class.html">client.Storage</a></code></b>:
      <code><a href="oauth2client.client.Storage-class.html#delete">delete</a></code>,
      <code><a href="oauth2client.client.Storage-class.html#get">get</a></code>,
      <code><a href="oauth2client.client.Storage-class.html#put">put</a></code>
      </p>
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__delattr__</code>,
      <code>__format__</code>,
      <code>__getattribute__</code>,
      <code>__hash__</code>,
      <code>__new__</code>,
      <code>__reduce__</code>,
      <code>__reduce_ex__</code>,
      <code>__repr__</code>,
      <code>__setattr__</code>,
      <code>__sizeof__</code>,
      <code>__str__</code>,
      <code>__subclasshook__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== PROPERTIES ==================== -->
<a name="section-Properties"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Properties</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Properties"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__class__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Method Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-MethodDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="__init__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">service_name</span>,
        <span class="sig-arg">user_name</span>)</span>
    <br /><em class="fname">(Constructor)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="oauth2client.keyring_storage-pysrc.html#Storage.__init__">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">
Constructor.

Args:
  service_name: string, The name of the service under which the credentials
    are stored.
  user_name: string, The name of the user to store credentials for.

</pre>
  <dl class="fields">
    <dt>Overrides:
        object.__init__
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="acquire_lock"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">acquire_lock</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="oauth2client.keyring_storage-pysrc.html#Storage.acquire_lock">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">
Acquires any lock necessary to access this Storage.

This lock is not reentrant.

</pre>
  <dl class="fields">
    <dt>Overrides:
        <a href="oauth2client.client.Storage-class.html#acquire_lock">client.Storage.acquire_lock</a>
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="release_lock"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">release_lock</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="oauth2client.keyring_storage-pysrc.html#Storage.release_lock">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">
Release the Storage lock.

Trying to release a lock that isn't held will result in a
RuntimeError.

</pre>
  <dl class="fields">
    <dt>Overrides:
        <a href="oauth2client.client.Storage-class.html#release_lock">client.Storage.release_lock</a>
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="locked_get"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">locked_get</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="oauth2client.keyring_storage-pysrc.html#Storage.locked_get">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">
Retrieve Credential from file.

Returns:
  oauth2client.client.Credentials

</pre>
  <dl class="fields">
    <dt>Overrides:
        <a href="oauth2client.client.Storage-class.html#locked_get">client.Storage.locked_get</a>
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="locked_put"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">locked_put</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">credentials</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="oauth2client.keyring_storage-pysrc.html#Storage.locked_put">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">
Write Credentials to file.

Args:
  credentials: Credentials, the credentials to store.

</pre>
  <dl class="fields">
    <dt>Overrides:
        <a href="oauth2client.client.Storage-class.html#locked_put">client.Storage.locked_put</a>
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="locked_delete"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">locked_delete</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="oauth2client.keyring_storage-pysrc.html#Storage.locked_delete">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">
Delete Credentials file.

Args:
  credentials: Credentials, the credentials to store.

</pre>
  <dl class="fields">
    <dt>Overrides:
        <a href="oauth2client.client.Storage-class.html#locked_delete">client.Storage.locked_delete</a>
    </dt>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="oauth2client-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Mon Sep 29 15:21:53 2014
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
